package com.elinkway.infinitemovies.bigdata;

import android.content.Context;
import android.content.SharedPreferences;

import com.elinkway.infinitemovies.application.MoviesApplication;
import com.elinkway.infinitemovies.config.SettingManage;
import com.elinkway.infinitemovies.ui.activity.LoginActivity;
import com.elinkway.infinitemovies.utils.MoviesUtils;

/**
 * Created by chengjianlong on 2017/4/24.
 */

public class RealDataConfig {

    //超级视频为0 影视大全为1 快看2 闪电3 TV 4

    public static final String CJSP_SARRS = "0";
    public static final String YSDQ_SARRS = "1";
    public static final String KUAIKAN_SARRS = "2";
    public static final String LIGHTNING_SARRS = "3";
    public static final String TV_SARRS = "4";
    public static final String REAL_DATA_ACODE_CLICK = "0"; //点击
    public static final String REAL_DATA_ACODE_COLLECTION = "3";//收藏
    public static final String REAL_DATA_ACODE_SHARE = "4";//分享
    public static final String REAL_DATA_ACODE_SEARCH = "search";//搜索

    private SharedPreferences mLoginSp;
    private static RealDataConfig realDataConfig = null;

    public static RealDataConfig getInstance() {
        if (realDataConfig != null) {
            return realDataConfig;
        }
        realDataConfig = new RealDataConfig();
        return realDataConfig;
    }

    ;

    public static final String ANDROID_OS = "0";//安卓0 iOS1 iPad2


    public RealDataConfig() {
        if (mLoginSp == null) {
            mLoginSp = MoviesApplication.getInstance().getSharedPreferences(SettingManage.LOGIN_INFO, Context.MODE_PRIVATE);
        }
    }


    public String getUid() {
        return mLoginSp.getString(LoginActivity.UID, "");
    }

    ;

    public static String getSarrs() {
        String sarrsType = null;
        if (MoviesUtils.isProductCjsp()) {
            sarrsType = CJSP_SARRS;
        } else if (MoviesUtils.isProductYsdq()) {
            sarrsType = YSDQ_SARRS;
        } else if (MoviesUtils.isProductKuaiKan()) {
            sarrsType = KUAIKAN_SARRS;
        } else if (MoviesUtils.isProductLightning()) {
            sarrsType = LIGHTNING_SARRS;
        } else {
            sarrsType = TV_SARRS;
        }
        return sarrsType;
    }
}
